<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        function isYear(year){
            return (year%400 == 0) || (year%4 == 0 && year % 100 != 0);
        }
        let year = parseInt(prompt('请输入一个年份'));
        if(isYear(year)){
            alert('输入年份为闰年');
        }else alert('输入年份为平年');
    </script>
</body>
</html>